using System;
using System.Collections.Generic;
using System.Linq;

namespace Unbound.Configuration
{
	internal class UnbindingContext : IUnbindingRequest
	{
		readonly IEnumerable<string> _propertiesToSkip;
		readonly Dictionary<string, object> _result;

		public UnbindingContext(object source, string prefix, IEnumerable<string> propertiesToSkip)
		{
			Source = source;
			Prefix = prefix;
			_propertiesToSkip = propertiesToSkip;
			_result = new Dictionary<string, object>();
		}

		public IDictionary<string, object> Result { get { return _result; } }

		public object Source { get; set; }

		public string[] PropertiesToSkip { get { return _propertiesToSkip.ToArray(); } }

		public string Prefix { get; set; }

		public Type SourceType { get { return Source.GetType(); } }
	}
}